/*
 * @Author: Bboy大蛇 2951845438@qq.com
 * @Date: 2024-07-28 15:23:02
 * @LastEditors: Bboy大蛇 2951845438@qq.com
 * @LastEditTime: 2024-08-27 10:00:25
 * @FilePath: \MyProject_3D\assets\script\src\Main\GameScene.ts
 */
import { _decorator, Component, instantiate, Prefab } from 'cc';
import { LayerManager } from '../Basic/Manager/LayerManager';
import { BasePrefab } from '../Basic/Config/BaseEnum';
import { DataMgr } from '../Basic/Manager/DataManager';
import { LoadingManager } from '../Basic/Manager/LoadingManager';
import { RedDotManager } from '../Basic/Model/RedDot/RedDotManager';
import { OpenLoadModel } from '../Basic/UI/OpenLoadPanel';
import { LevelModel } from '../Game/Level/LevelModel';
// import { GameModel } from '../Game/Game/GameModel';
const { ccclass } = _decorator;

@ccclass('GameScene')
export class GameScene extends Component {
  protected start(): void {
    // MainPanel.Show();
    console.log('show UIControler');
    LayerManager.Singleton.node.setScale(1, 1);
    // MainModel.Ins().Show();
    // GameModel.Ins().Show();
  }

  async initGameScene() {
    //初始化数据
    DataMgr.checkNewDay();
    RedDotManager.Ins().initRedDotData();
    const node = instantiate(LoadingManager.Ins().getResource<Prefab>(BasePrefab.ui_controller));
    this.node.parent.addChild(node);
    LayerManager.Singleton.init();
    LayerManager.Singleton.initLoading(OpenLoadModel.Ins().loadRes);
    LevelModel.Ins().Show();
  }
}
